export type PositionConfig = {
  width: number
  height: number
  top: number
  left: number
}

export interface LoadingProps {
  parentClass?: string //父节点的样式名，当需要局部显示Loading时需设置该属性，亦可使用startLoading()方法传入参数手动设置
  fullscreen?: boolean //是否全屏显示Loading，默认为false，优先度排行：startLoading()自定义参数 > fullscreen > parentClass
  showMask?: boolean //是否显示Loading背景，默认为true
  maskColor?: string //Loading背景颜色，默认为白色，仅当showMask为true时生效
  loadingColor?: string //Loading主体颜色，默认为'#f4756b'
  allowTouch?: boolean //是否允许触摸穿透遮罩层，默认为false
  startFromInit?: boolean //是否在加载时就启用loading
}

export interface LoadingMethod {
  startLoading: (positionConfig: PositionConfig | null) => Promise<string>
  stopLoading: () => Promise<string>
  isLoading: boolean
}